package com.hh.test.design.builder;

public class Director {

	private Builder builder;

	public Builder getBuilder() {
		return builder;
	}

	public void setBuilder(Builder builder) {
		this.builder = builder;
	}

	public Director(Builder builder) {
		super();
		this.builder = builder;
	}

	public void genarate() {
		builder.createPartA();
		builder.createPartB();
		builder.createPartC();
	}

	public static void main(String[] args) {
		Builder builder = new PartBuilder();
		Director dir = new Director(builder);
		dir.genarate();
		Product pro = builder.create();
		pro.print();
		System.out.println(pro);
	}
}
